package ar.edu.itba.it.cg.grupo01.impl.shape.shader;

import java.awt.Color;

import javax.vecmath.Point2f;
import javax.vecmath.Point3f;

import ar.edu.itba.it.cg.grupo01.api.shape.Shape;

public class FireShader extends PerlinShader {

	public FireShader(Color noNoise, Color fullNoise, int times, float persistence) {
		super(noNoise,fullNoise, times, persistence);
	}

	@Override
	public float getNoise(Shape shape, Point3f intersectionPoint) {
		Point2f uv = shape.getUVCoordinates(intersectionPoint);
		return turbulence(uv);
	}

	@Override
	protected float getTurbulenceFunction(Point3f p, float noise, float frequency, int times) {
		return (1.0f / times) * noise * frequency;
	}
}
